//
// File: only_vehicle_model.h
//
// Code generated for Simulink model 'only_vehicle_model'.
//
// Model version                  : 1.4
// Simulink Coder version         : 9.9 (R2023a) 19-Nov-2022
// C/C++ source code generated on : Sun Dec 10 22:42:43 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: Intel->x86-64 (Windows64)
// Code generation objectives: Unspecified
// Validation result: Not run
//
#ifndef RTW_HEADER_only_vehicle_model_h_
#define RTW_HEADER_only_vehicle_model_h_
#include "rtwtypes.h"
#include "rtw_continuous.h"
#include "rtw_solver.h"
#include "only_vehicle_model_types.h"
#include <cstring>

// Macros for accessing real-time model data structure
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

#ifndef rtmGetStopRequested
#define rtmGetStopRequested(rtm)       ((rtm)->Timing.stopRequestedFlag)
#endif

#ifndef rtmSetStopRequested
#define rtmSetStopRequested(rtm, val)  ((rtm)->Timing.stopRequestedFlag = (val))
#endif

#ifndef rtmGetStopRequestedPtr
#define rtmGetStopRequestedPtr(rtm)    (&((rtm)->Timing.stopRequestedFlag))
#endif

#ifndef rtmGetT
#define rtmGetT(rtm)                   (rtmGetTPtr((rtm))[0])
#endif

#ifndef rtmGetTPtr
#define rtmGetTPtr(rtm)                ((rtm)->Timing.t)
#endif

#ifndef ODE3_INTG
#define ODE3_INTG

// ODE3 Integration Data
struct ODE3_IntgData {
  real_T *y;                           // output
  real_T *f[3];                        // derivatives
};

#endif

//
//  Exported Global Signals
//
//  Note: Exported global signals are block signals with an exported global
//  storage class designation.  Code generation will declare the memory for
//  these signals and export their symbols.
//

extern real_T total_lon_force_front_axle;// '<Root>/In1'
extern real_T total_lon_force_rear_axle;// '<Root>/In2'
extern real_T road_grade;              // '<Root>/In3'

// Class declaration for model only_vehicle_model
class only_vehicle_model final
{
  // public data and function members
 public:
  // Block signals (default storage)
  struct B_only_vehicle_model_T {
    real_T Integrator;                 // '<S5>/Integrator'
    real_T xddot;                      // '<S5>/1//m'
    real_T VectorConcatenate2[3];      // '<S2>/Vector Concatenate2'
  };

  // Continuous states (default storage)
  struct X_only_vehicle_model_T {
    real_T Integrator_CSTATE;          // '<S5>/Integrator'
    real_T Integrator1_CSTATE;         // '<S2>/Integrator1'
    real_T Integrator3_CSTATE;         // '<S13>/Integrator3'
  };

  // State derivatives (default storage)
  struct XDot_only_vehicle_model_T {
    real_T Integrator_CSTATE;          // '<S5>/Integrator'
    real_T Integrator1_CSTATE;         // '<S2>/Integrator1'
    real_T Integrator3_CSTATE;         // '<S13>/Integrator3'
  };

  // State disabled
  struct XDis_only_vehicle_model_T {
    boolean_T Integrator_CSTATE;       // '<S5>/Integrator'
    boolean_T Integrator1_CSTATE;      // '<S2>/Integrator1'
    boolean_T Integrator3_CSTATE;      // '<S13>/Integrator3'
  };

  // Invariant block signals (default storage)
  struct ConstB_only_vehicle_model_T {
    real_T VectorConcatenate[3];       // '<S16>/Vector Concatenate'
    real_T TmpSignalConversionAtsincos[3];
    real_T sincos_o1[3];               // '<S18>/sincos'
    real_T sincos_o2[3];               // '<S18>/sincos'
    real_T Fcn11;                      // '<S18>/Fcn11'
    real_T Fcn21;                      // '<S18>/Fcn21'
    real_T Fcn31;                      // '<S18>/Fcn31'
    real_T Fcn12;                      // '<S18>/Fcn12'
    real_T Fcn22;                      // '<S18>/Fcn22'
    real_T Fcn32;                      // '<S18>/Fcn32'
    real_T Fcn13;                      // '<S18>/Fcn13'
    real_T Fcn23;                      // '<S18>/Fcn23'
    real_T Fcn33;                      // '<S18>/Fcn33'
    real_T VectorConcatenate_e[9];     // '<S22>/Vector Concatenate'
    real_T VectorConcatenate_i[3];     // '<S17>/Vector Concatenate'
    real_T sincos_o1_d[3];             // '<S25>/sincos'
    real_T sincos_o2_a[3];             // '<S25>/sincos'
    real_T Fcn11_g;                    // '<S25>/Fcn11'
    real_T Fcn21_b;                    // '<S25>/Fcn21'
    real_T Fcn31_i;                    // '<S25>/Fcn31'
    real_T Fcn12_j;                    // '<S25>/Fcn12'
    real_T Fcn22_g;                    // '<S25>/Fcn22'
    real_T Fcn32_n;                    // '<S25>/Fcn32'
    real_T Fcn13_d;                    // '<S25>/Fcn13'
    real_T Fcn23_n;                    // '<S25>/Fcn23'
    real_T Fcn33_c;                    // '<S25>/Fcn33'
    real_T VectorConcatenate_im[9];    // '<S29>/Vector Concatenate'
    real_T VectorConcatenate5[3];      // '<S43>/Vector Concatenate5'
    real_T UnaryMinus[3];              // '<S5>/Unary Minus'
    real_T Fz;                         // '<S5>/m'
  };

  // External outputs (root outports fed by signals with default storage)
  struct ExtY_only_vehicle_model_T {
    real_T vehicle_speed;              // '<Root>/vehicle_speed'
  };

  // Real-time Model Data Structure
  struct RT_MODEL_only_vehicle_model_T {
    const char_T *errorStatus;
    RTWSolverInfo solverInfo;
    X_only_vehicle_model_T *contStates;
    int_T *periodicContStateIndices;
    real_T *periodicContStateRanges;
    real_T *derivs;
    XDis_only_vehicle_model_T *contStateDisabled;
    boolean_T zCCacheNeedsReset;
    boolean_T derivCacheNeedsReset;
    boolean_T CTOutputIncnstWithState;
    real_T odeY[3];
    real_T odeF[3][3];
    ODE3_IntgData intgData;

    //
    //  Sizes:
    //  The following substructure contains sizes information
    //  for many of the model attributes such as inputs, outputs,
    //  dwork, sample times, etc.

    struct {
      int_T numContStates;
      int_T numPeriodicContStates;
      int_T numSampTimes;
    } Sizes;

    //
    //  Timing:
    //  The following substructure contains information regarding
    //  the timing information for the model.

    struct {
      uint32_T clockTick0;
      time_T stepSize0;
      uint32_T clockTick1;
      SimTimeStep simTimeStep;
      boolean_T stopRequestedFlag;
      time_T *t;
      time_T tArray[2];
    } Timing;
  };

  // Copy Constructor
  only_vehicle_model(only_vehicle_model const&) = delete;

  // Assignment Operator
  only_vehicle_model& operator= (only_vehicle_model const&) & = delete;

  // Move Constructor
  only_vehicle_model(only_vehicle_model &&) = delete;

  // Move Assignment Operator
  only_vehicle_model& operator= (only_vehicle_model &&) = delete;

  // Real-Time Model get method
  only_vehicle_model::RT_MODEL_only_vehicle_model_T * getRTM();

  // Root outports get method
  const ExtY_only_vehicle_model_T &getExternalOutputs() const
  {
    return only_vehicle_model_Y;
  }

  // model initialize function
  void initialize();

  // model step function
  void step();

  // model terminate function
  static void terminate();

  // Constructor
  only_vehicle_model();

  // Destructor
  ~only_vehicle_model();

  // private data and function members
 private:
  // External outputs
  ExtY_only_vehicle_model_T only_vehicle_model_Y;

  // Block signals
  B_only_vehicle_model_T only_vehicle_model_B;

  // Block continuous states
  X_only_vehicle_model_T only_vehicle_model_X;

  // Continuous states update member function
  void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si );

  // Derivatives member function
  void only_vehicle_model_derivatives();

  // Real-Time Model
  RT_MODEL_only_vehicle_model_T only_vehicle_model_M;
};

extern const only_vehicle_model::ConstB_only_vehicle_model_T
  only_vehicle_model_ConstB;           // constant block i/o

//-
//  These blocks were eliminated from the model due to optimizations:
//
//  Block '<S13>/Constant11' : Unused code path elimination
//  Block '<S13>/Unit Conversion' : Unused code path elimination
//  Block '<S14>/1//NF' : Unused code path elimination
//  Block '<S14>/1//NR' : Unused code path elimination
//  Block '<S14>/Constant10' : Unused code path elimination
//  Block '<S14>/Constant14' : Unused code path elimination
//  Block '<S14>/Constant3' : Unused code path elimination
//  Block '<S14>/Constant4' : Unused code path elimination
//  Block '<S14>/Constant6' : Unused code path elimination
//  Block '<S14>/Constant8' : Unused code path elimination
//  Block '<S14>/Constant9' : Unused code path elimination
//  Block '<S14>/Selector' : Unused code path elimination
//  Block '<S14>/Selector1' : Unused code path elimination
//  Block '<S14>/Unary Minus' : Unused code path elimination
//  Block '<S14>/Unary Minus1' : Unused code path elimination
//  Block '<S16>/Add' : Unused code path elimination
//  Block '<S16>/Add1' : Unused code path elimination
//  Block '<S16>/Add4' : Unused code path elimination
//  Block '<S22>/Reshape (9) to [3x3] column-major' : Unused code path elimination
//  Block '<S16>/Transpose1' : Unused code path elimination
//  Block '<S19>/Product' : Unused code path elimination
//  Block '<S19>/Reshape1' : Unused code path elimination
//  Block '<S19>/Reshape2' : Unused code path elimination
//  Block '<S20>/Product' : Unused code path elimination
//  Block '<S20>/Reshape1' : Unused code path elimination
//  Block '<S20>/Reshape2' : Unused code path elimination
//  Block '<S23>/i x j' : Unused code path elimination
//  Block '<S23>/j x k' : Unused code path elimination
//  Block '<S23>/k x i' : Unused code path elimination
//  Block '<S24>/i x k' : Unused code path elimination
//  Block '<S24>/j x i' : Unused code path elimination
//  Block '<S24>/k x j' : Unused code path elimination
//  Block '<S21>/Sum' : Unused code path elimination
//  Block '<S17>/Add' : Unused code path elimination
//  Block '<S17>/Add1' : Unused code path elimination
//  Block '<S17>/Add4' : Unused code path elimination
//  Block '<S29>/Reshape (9) to [3x3] column-major' : Unused code path elimination
//  Block '<S17>/Transpose1' : Unused code path elimination
//  Block '<S26>/Product' : Unused code path elimination
//  Block '<S26>/Reshape1' : Unused code path elimination
//  Block '<S26>/Reshape2' : Unused code path elimination
//  Block '<S27>/Product' : Unused code path elimination
//  Block '<S27>/Reshape1' : Unused code path elimination
//  Block '<S27>/Reshape2' : Unused code path elimination
//  Block '<S30>/i x j' : Unused code path elimination
//  Block '<S30>/j x k' : Unused code path elimination
//  Block '<S30>/k x i' : Unused code path elimination
//  Block '<S31>/i x k' : Unused code path elimination
//  Block '<S31>/j x i' : Unused code path elimination
//  Block '<S31>/k x j' : Unused code path elimination
//  Block '<S28>/Sum' : Unused code path elimination
//  Block '<S10>/Constant10' : Unused code path elimination
//  Block '<S10>/Constant12' : Unused code path elimination
//  Block '<S32>/Product' : Unused code path elimination
//  Block '<S34>/Reshape (9) to [3x3] column-major' : Unused code path elimination
//  Block '<S32>/Transpose' : Unused code path elimination
//  Block '<S35>/Constant' : Unused code path elimination
//  Block '<S35>/Constant1' : Unused code path elimination
//  Block '<S35>/Product' : Unused code path elimination
//  Block '<S35>/Product1' : Unused code path elimination
//  Block '<S35>/Product8' : Unused code path elimination
//  Block '<S35>/Unary Minus' : Unused code path elimination
//  Block '<S35>/Unary Minus1' : Unused code path elimination
//  Block '<S35>/Unit Conversion' : Unused code path elimination
//  Block '<S41>/Reshape (9) to [3x3] column-major' : Reshape block reduction


//-
//  The generated code includes comments that allow you to trace directly
//  back to the appropriate location in the model.  The basic format
//  is <system>/block_name, where system is the system number (uniquely
//  assigned by Simulink) and block_name is the name of the block.
//
//  Use the MATLAB hilite_system command to trace the generated code back
//  to the model.  For example,
//
//  hilite_system('<S3>')    - opens system 3
//  hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
//
//  Here is the system hierarchy for this model
//
//  '<Root>' : 'only_vehicle_model'
//  '<S1>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal'
//  '<S2>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF'
//  '<S3>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation'
//  '<S4>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Inertial Axes'
//  '<S5>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Vehicle'
//  '<S6>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/WindDim'
//  '<S7>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Body Frame'
//  '<S8>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Forces'
//  '<S9>'   : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing'
//  '<S10>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Inertial Frame'
//  '<S11>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Moments'
//  '<S12>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Power'
//  '<S13>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Body Frame/Longitudinal 1DOF'
//  '<S14>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Forces/Forces 1DOF'
//  '<S15>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF'
//  '<S16>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front'
//  '<S17>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear'
//  '<S18>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/Rotation Angles to Direction Cosine Matrix'
//  '<S19>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/transform to Inertial axes'
//  '<S20>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/transform to Inertial axes1'
//  '<S21>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/wxR'
//  '<S22>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/Rotation Angles to Direction Cosine Matrix/Create 3x3 Matrix'
//  '<S23>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/wxR/Subsystem'
//  '<S24>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Front/wxR/Subsystem1'
//  '<S25>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/Rotation Angles to Direction Cosine Matrix'
//  '<S26>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/transform to Inertial axes'
//  '<S27>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/transform to Inertial axes1'
//  '<S28>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/wxR'
//  '<S29>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/Rotation Angles to Direction Cosine Matrix/Create 3x3 Matrix'
//  '<S30>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/wxR/Subsystem'
//  '<S31>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Frame Routing/Longitudinal 1DOF/Hard Point Coordinate Transform Rear/wxR/Subsystem1'
//  '<S32>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Inertial Frame/Inertial Axes'
//  '<S33>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Inertial Frame/Inertial Axes/Rotation Angles to Direction Cosine Matrix'
//  '<S34>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Inertial Frame/Inertial Axes/Rotation Angles to Direction Cosine Matrix/Create 3x3 Matrix'
//  '<S35>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Power/Longitudinal 1DOF'
//  '<S36>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Power/Longitudinal 1DOF/Power Accounting Bus Creator'
//  '<S37>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Power/Longitudinal 1DOF/Power Accounting Bus Creator/PwrNotTrnsfrd Input'
//  '<S38>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Power/Longitudinal 1DOF/Power Accounting Bus Creator/PwrStored Input'
//  '<S39>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Bus Creation/Power/Longitudinal 1DOF/Power Accounting Bus Creator/PwrTrnsfrd Input'
//  '<S40>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Inertial Axes/Rotation Angles to Direction Cosine Matrix'
//  '<S41>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Inertial Axes/Rotation Angles to Direction Cosine Matrix/Create 3x3 Matrix'
//  '<S42>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/Vehicle/Drag Force'
//  '<S43>'  : 'only_vehicle_model/Vehicle Body 1DOF Longitudinal/Vehicle Body 1 DOF/WindDim/WindX'

#endif                                 // RTW_HEADER_only_vehicle_model_h_

//
// File trailer for generated code.
//
// [EOF]
//
